int LED0blink() //50% off 50% on
{
    static int counter = 0;
    static int x = 0;
    if (counter >   0 && counter < 128) x = 255;
    if (counter > 128 && counter < 255) x =   0;
    counter = counter+4;
    return x;
}

int LED1blink()
{
    static int counter = 0;
    static int x = 0;
    if (counter >   0 && counter <  64) x =   0;
    if (counter >  63 && counter < 192) x = 255;
    if (counter > 191 && counter < 255) x =   0;
    counter = counter+4;
    return x;
}

int LED2blink()
{
    static int counter = 0;
    static int x = 0;
    if (counter >   0 && counter < 128) x =   0;
    if (counter > 128 && counter < 255) x = 255;
    counter = counter+4;
    return x;
}

int LED0dblblink() //50% off 50% on
{
    static int counter = 0;
    static int x = 0;
    if (counter >   0 && counter < 128) x = 255;
    if (counter > 128 && counter < 255) x =   0;
    counter = counter+8;
    return x;
}

int LED1dblblink()
{
    static int counter = 0;
    static int x = 0;
    if (counter >   0 && counter <  64) x =   0;
    if (counter >  63 && counter < 192) x = 255;
    if (counter > 191 && counter < 255) x =   0;
    counter = counter+8;
    return x;
}

int LED2dblblink()
{
    static int counter = 0;
    static int x = 0;
    if (counter >   0 && counter < 128) x =   0;
    if (counter > 128 && counter < 255) x = 255;
    counter = counter+8;
    return x;
}

int LED0pattern1()
{
    static int counter = 0;
    static int x = 8;
    if      (counter <  65) x = x+2;
    else if (counter < 130) x = x-2;
    counter++;
    return x;
}

int LED1pattern1()
{
    static int counter = 0;
    static int x = 8;
    if      (counter >   64 && counter < 129) x = x+2;
    else if (counter >  128 && counter < 193) x = x-2;
    counter++;
    return x;
}

int LED2pattern1()
{
    static int counter = 0;
    static int x = 8;
    if      (counter >  128 && counter < 193) x = x+2;
    else if (counter >  191 && counter < 256) x = x-2;
    counter++;
    return x;
}

int LED0pattern2()
{
    static int counter = 0;
    static int x = 0;
    if (counter >  64 && counter < 129) x = x+1;
    if (counter > 128 && counter < 193) x = x-1;
    counter++;
    return x;
}

int LED1pattern2()
{
    static int counter = 0;
    static int x = 0;
    if (counter >  64 && counter < 129) x = x+1;
    if (counter > 128 && counter < 193) x = x-1;
    counter++;
    return x;
}